import fetch from "./fetch";

// 请求首页的接口
export const ApiGetHomeData = () => fetch("/6666", {}, {}, "GET");

// 请求切换考试题目的接口
export const ApiToggleData = (actionCode: string = "") =>
  fetch("/6666/" + actionCode, {}, {}, "GET");

// 设置考试题目的接口
export const ApiSetExam = (actionCode: string = "") =>
  fetch("/6666/" + actionCode, {}, {}, "POST");

// 请求侧边的数据
export const ApiToggleSideData = () => fetch("/6666/field", {}, {}, "GET");

// 登录接口
export const ApiLogin = (username: string, password: string) =>
  fetch(
    "/1024/login",
    {
      username,
      password,
    },
    {},
    "POST"
  );

// 注册接口
export const ApiRegister = (
  nickName: string,
  phone: string,
  password: string
) =>
  fetch(
    "/1024/register",
    {
      nickName,
      phone,
      password,
    },
    {},
    "POST"
  );

// 快速刷题
export const ApiQuick = () => fetch("/4698", {}, {}, "GET");

// 设置考试题目的接口
export const ApiPratice = (actionCode: string, testType: string) =>
  fetch(`/1314/${actionCode}/${testType}`, {}, {}, "GET");

//练习刷题 ApiPratice
// export const ApiPratice = (actionCode: string, testType: string) =>
// fetch(`/1314/${actionCode}/${testType}`, {}, "GET");

//获取题目列表信息
export const ApiQdTest = (params: object) => fetch("/1314", params);


//提交答案内容
export const ApiQdTestPut = (params: object) =>
  fetch("/1314", params, {}, "PUT");
